use axum::{
    Json,
    http::HeaderMap,
};
use serde_json::Value;

pub fn get_ip(header:HeaderMap) -> Result<String, Json<Value>> { 
    eprintln!("{:#?}", header);
    if let Some(f) = header.get("Remote") {
        
        Ok( f.to_str().unwrap_or("Unknown").to_string() )
    } else {
        Ok( "Unknown".to_string() )
    }
}